﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Compilation;
using System.CodeDom;
using System.Web.UI;
using System.Web;
using System.Diagnostics;

namespace Beetle.Web
{
    public class TowWayBindExpressionBuilder : ExpressionBuilder
    {
        public override System.CodeDom.CodeExpression GetCodeExpression(System.Web.UI.BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
        {
            if ((entry.DeclaringType == null) || (entry.PropertyInfo == null))
            {
                return new CodeExpression();
            }

            //StackTrace trace = new StackTrace();
            //StackFrame[] frames = trace.GetFrames();

            //StackFrame frame = frames[0];
         
            // DataBinder.Eval(
            return new CodeCastExpression("Int64", new CodePrimitiveExpression(1000));
        }
    }
}
